<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
		<div class="left-bar-container">
			<div class="logo">
				<img src="images/logo.png" />
				<h2>电子商务</h2>
			</div>
		</div>
		
		<form action="exportExcel/downLoadPageExcel" id="exportForm" method="post">
			<input type="hidden" name="cList" id="cList" value=""> 
			<input type="hidden" name="titleName" id="titleName" value=""> 
			<input type="hidden" name="tableTitleId" id="tableTitleId" value=""> 
		</form>
<script>
var menuArry =${sessionScope.roleList};
var thisurl = window.location.href;
var urlarray = thisurl.split("/");
var paramurl = urlarray[urlarray.length - 2];
var paramlast=urlarray[urlarray.length - 1];
var herfurl=paramurl+'/'+paramlast;


//放到公用
function setOptionTimeCount(functionName,timedCount){
	if(dataFlag == true) {
		setOptionStart(functionName);
		if(timedCount != null){clearTimeout(timedCount);
		timedCount = null;
	}
	}else{
		timedCount = setTimeout("setOptionTimeCount('"+functionName+"',"+timedCount+")",100)
	}
}
$(function () {
	GetData(0, menuArry)
	$(".left-bar-container").append(menus);
	$(".firstbar a").each(function(){
		if(herfurl.indexOf($(this).attr("href"))!=-1){
			$(this).addClass("active");
			$(this).siblings("ul").css("display","block");
			$(this).parents("ul").css("display","block");
			$(this).parents("li").addClass("active");
		}
	})
});

	//菜单列表html
	var menus = '';
	//根据菜单主键id生成菜单列表html
	//id：菜单主键id
	//arry：菜单数组信息
	function GetData(id, arry) {
	var childArry = GetParentArry(id, arry);
	if (childArry.length > 0) {
		var bar;
		if(childArry[0].MENU_LEVEL=='1'){
			bar="firstbar";
		}else if(childArry[0].MENU_LEVEL=='2'){
			bar="secondbar";
		}else if(childArry[0].MENU_LEVEL=='3'){
			bar="thirdbar";
		}
		menus += '<ul class='+bar+' style="display:none">';
			for (var i in childArry) {
				var spanf='';
				var spans='';
				var enable='';
				if(childArry[i].MENU_ICON!=null & childArry[i].MENU_ICON!='') 
				    spanf='<span class="iconfont '+childArry[i].MENU_ICON+'"></span>';
			    if(childArry[i].HASLEAF=='1') 
			    	spans='<span class="iconfont icon-shang"></span>';
			    if(childArry[i].MENU_URL=='javascript:void(0)')
			    	enable='class=bukedianji';
 			    if(childArry[i].MENU_NAME=='舆情中心')
 			    	enable='onclick="js_method()"';
//			    if(childArry[i].MENU_NAME=='平台共享')
//					enable='style="cursor: default; color: #969696;background: #1a4780;"'
				menus += '<li><a '+enable+' href='+childArry[i].MENU_URL+'>'+spanf+childArry[i].MENU_NAME+spans
						+'</a>';
				GetData(childArry[i].MENU_ID, arry);
				menus += '</li>';
			}
		menus += '</ul>';
		}
	}

	//根据菜单主键id获取下级菜单
	//id：菜单主键id
	//arry：菜单数组信息
	function GetParentArry(id, arry) {
	var newArry = new Array();
	for (var i in arry) {
	if (arry[i].MENU_PID == id)
	newArry.push(arry[i]);
	}
	return newArry;
	}
	function js_method(){
		window.open('http://www.mofcom.gov.cn');
	}
</script>